package cn.et;

import org.apache.tomcat.jdbc.pool.DataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.alibaba.druid.pool.DruidDataSource;
@Configuration
public class Config {
	
	@Value("${driverclassname}")
	private String driverclassname;
	
	@Value("${password}")
	private String password;
	
	@Value("${url}")
	private String url;
	
	@Value("${username}")
	private String username;
	
	@Bean
	public DruidDataSource myDataSource(){
		DruidDataSource dds= new DruidDataSource();
		dds.setUrl(url);
		dds.setDriverClassName(driverclassname);
		dds.setPassword(password);
		dds.setUsername(username);
		return dds ;
	}
}
